package sharewithus.content.dao.impl;

import java.util.List;
import java.util.UUID;

import framelib.dao.BaseDAOImpl;

import sharewithus.content.dao.IFeedRelationshipDao;
import sharewithus.content.dto.Feed;
import sharewithus.content.dto.FeedRelationship;
public class FeedRelationshipDaoImpl extends BaseDAOImpl implements IFeedRelationshipDao {
	
	//@Override
	public List<FeedRelationship> getSubscribedFeeds(String subscriberUserId) {
		return super.queryForList("content.getSubscribedFeedRelationships", subscriberUserId);
	}

	//@Override
	public void saveSubscriberFeeds(String subscriberUserId, Feed feed) {
		FeedRelationship fr = new FeedRelationship();
		fr.setFeedId(feed.getFeedId());
		fr.setFeedOwnerId(feed.getOwnerId());
		fr.setSubscribeUserId(subscriberUserId);
		fr.setId(UUID.randomUUID().toString());
		
		super.executeInsert("content.saveFeedRelationship", fr);
		//return 0;
	}

}
